<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>自媒体圈子管理</title>
	<meta name="decorator" content="default"/>
	<script type="text/javascript">
		$(document).ready(function() {
			
		});
		function page(n,s){
			$("#pageNo").val(n);
			$("#pageSize").val(s);
			$("#searchForm").submit();
        	return false;
        }
        function getIds() {
            var ids = [];
            $("input[name='ids']:checked").each(function () {
                ids.push({id:$(this).val(),name:$(this).attr("label")});
            });
            return ids;
        }
	</script>
</head>
<body>
<c:if test="${empty hkMediaCategoryCircle.checked}">
	<ul class="nav nav-tabs">
		<li class="active"><a href="${ctx}/media/hkMediaCategoryCircle/">自媒体圈子列表</a></li>
		<shiro:hasPermission name="media:hkMediaCategoryCircle:edit"><li><a href="${ctx}/media/hkMediaCategoryCircle/form">自媒体圈子添加</a></li></shiro:hasPermission>
	</ul>
</c:if>
	<form:form id="searchForm" modelAttribute="hkMediaCategoryCircle" action="${ctx}/media/hkMediaCategoryCircle/" method="post" class="breadcrumb form-search">
		<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
		<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
		<input id="checked" name="checked" type="hidden" value="${hkMediaCategoryCircle.checked}"/>
		<ul class="ul-form">
			<li><label>分类名称：</label>
				<form:input path="hkCategory.name" htmlEscape="false" maxlength="100" class="input-medium"/>
			</li>
			<li><label>圈主名称：</label>
				<form:input path="user.name" htmlEscape="false" maxlength="100" class="input-medium"/>
			</li>
			<li><label>名称：</label>
				<form:input path="name" htmlEscape="false" maxlength="100" class="input-medium"/>
			</li>
			<li><label>是否发布：</label>
				<form:select path="state" class="input-medium">
					<form:option value="" label=""/>
					<form:options items="${fns:getDictList('yes_no')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
				</form:select>
			</li>
			<li><label>是否推荐：</label>
				<form:select path="recommend" class="input-medium">
					<form:option value="" label=""/>
					<form:options items="${fns:getDictList('yes_no')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
				</form:select>
			</li>
			<li class="btns"><input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/></li>
			<li class="clearfix"></li>
		</ul>
	</form:form>
	<sys:message content="${message}"/>
	<table id="contentTable" class="table table-striped table-bordered table-condensed">
		<thead>
			<tr>
				<c:if test="${not empty hkMediaCategoryCircle.checked}">
					<th>选择</th>
				</c:if>
				<th>分类名称</th>
				<th>名称</th>
				<th>圈主</th>
				<th>是否发布</th>
				<th>是否推荐</th>
				<th>创建时间</th>
				<th>备注</th>
				<c:if test="${ empty hkMediaCategoryCircle.checked}">
				<shiro:hasPermission name="media:hkMediaCategoryCircle:edit"><th>操作</th></shiro:hasPermission>
				</c:if>
			</tr>
		</thead>
		<tbody>
		<c:forEach items="${page.list}" var="hkMediaCategoryCircle2">
			<tr>
				<c:if test="${not empty hkMediaCategoryCircle.checked}">
					<td>
						<input type="checkbox" name="ids" value="${hkMediaCategoryCircle2.id}" label="${hkMediaCategoryCircle2.name}">
					</td>
				</c:if>
				<td>
					<c:if test="${not empty hkMediaCategoryCircle.checked}">
						${hkMediaCategoryCircle2.name}
					</c:if>
					<c:if test="${ empty hkMediaCategoryCircle.checked}">
						<a href="${ctx}/media/hkMediaCategoryCircle/form?id=${hkMediaCategoryCircle2.id}">
								${hkMediaCategoryCircle2.hkCategory.name}
						</a>
					</c:if>

				</td>
				<td>
						${hkMediaCategoryCircle2.name}
				</td>
				<td>
						${hkMediaCategoryCircle2.user.name}
				</td>
				<td>
					${fns:getDictLabel(hkMediaCategoryCircle2.state, 'yes_no', '')}
				</td>
				<td>
					${fns:getDictLabel(hkMediaCategoryCircle2.recommend, 'yes_no', '')}
				</td>
				<td>
					<fmt:formatDate value="${hkMediaCategoryCircle2.createDate}" pattern="yyyy-MM-dd HH:mm:ss"/>
				</td>
				<td>
					${hkMediaCategoryCircle2.remarks}
				</td>
				<c:if test="${ empty hkMediaCategoryCircle.checked}">
				<shiro:hasPermission name="media:hkMediaCategoryCircle:edit"><td>
    				<a href="${ctx}/media/hkMediaCategoryCircle/form?id=${hkMediaCategoryCircle2.id}">修改</a>
					<a href="${ctx}/media/hkMediaCategoryCircle/delete?id=${hkMediaCategoryCircle2.id}" onclick="return confirmx('确认要删除该自媒体圈子吗？', this.href)">删除</a>
				</td></shiro:hasPermission>
				</c:if>
			</tr>
		</c:forEach>
		</tbody>
	</table>
	<div class="pagination">${page}</div>
</body>
</html>